(function() {
    var b = mobiscroll,
        a = b.$;
    b.themes.frame.bootstrap = {
        dateDisplay: 'Mddyy',
        disabledClass: 'disabled',
        activeClass: 'btn-primary',
        activeTabClass: 'active',
        todayClass: 'text-primary',
        btnCalPrevClass: '',
        btnCalNextClass: '',
        onMarkupInserted: function(c) {
            var b = a(c.target);
            a('.mbsc-fr-popup', b).addClass('popover');
            a('.mbsc-fr-w', b).addClass('popover-content');
            a('.mbsc-fr-hdr', b).addClass('popover-title');
            a('.mbsc-fr-arr-i', b).addClass('popover');
            a('.mbsc-fr-arr', b).addClass('arrow');
            a('.mbsc-fr-btn', b).addClass('btn btn-default');
            a('.mbsc-fr-btn-s .mbsc-fr-btn', b).removeClass('btn-default').addClass('btn btn-primary');
            a('.mbsc-sc-btn-plus', b).addClass('glyphicon glyphicon-chevron-down');
            a('.mbsc-sc-btn-minus', b).addClass('glyphicon glyphicon-chevron-up');
            a('.mbsc-cal-next .mbsc-cal-btn-txt', b).prepend('<i class="glyphicon glyphicon-chevron-right"></i>');
            a('.mbsc-cal-prev .mbsc-cal-btn-txt', b).prepend('<i class="glyphicon glyphicon-chevron-left"></i>');
            a('.mbsc-cal-tabs ul', b).addClass('nav nav-tabs');
            a('.mbsc-cal-sc-c', b).addClass('popover');
            a('.mbsc-cal-week-nrs-c', b).addClass('popover');
            a('.mbsc-cal-events', b).addClass('popover');
            a('.mbsc-cal-events-arr', b).addClass('arrow');
            a('.mbsc-range-btn', b).addClass('btn btn-sm btn-small btn-default');
            a('.mbsc-np-btn', b).addClass('btn btn-default');
        },
        onPosition: function(b) {
            setTimeout(function() {
                a('.mbsc-fr-bubble-top, .mbsc-fr-bubble-top .mbsc-fr-arr-i', b.target).removeClass('bottom').addClass('top');
                a('.mbsc-fr-bubble-bottom, .mbsc-fr-bubble-bottom .mbsc-fr-arr-i', b.target).removeClass('top').addClass('bottom');
            }, 10);
        },
        onEventBubbleShow: function(c) {
            var b = a(c.eventList);
            a('.mbsc-cal-event-list', b).addClass('list-group');
            a('.mbsc-cal-event', b).addClass('list-group-item');
            setTimeout(function() {
                if (b.hasClass('mbsc-cal-events-b')) {
                    b.removeClass('top').addClass('bottom');
                } else {
                    b.removeClass('bottom').addClass('top');
                }
            }, 10);
        }
    };
}());